package com.settlement.system.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.settlement.system.common.base.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
        import java.math.BigDecimal;
        import java.time.LocalDateTime;

/**
* <p>
* 小红书订单销售
* </p>
*
* @author huangrensen
* @since 2024-07-02
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class XhsBill extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
    * 账单ID
    */
    private String id;


    /**
    * 店铺ID
    */
    private Long storeId;
    @TableField(exist = false)
    private String storeName;


    /**
    * 结算时间
    */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime settlementTime;


    /**
    * 下单时间
    */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime orderTime;


    /**
    * 完成时间
    */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime finishTime;


    /**
    * 订单号
    */
    private String orderNo;


    /**
    * 金额
    */
    private BigDecimal incomeAmount = BigDecimal.ZERO;


    /**
    * 结算帐户
    */
    private String account;


    /**
    * 计佣基数
    */
    private BigDecimal commissionNo = BigDecimal.ZERO;


    /**
    * 商品实付
    */
    private BigDecimal actAmount = BigDecimal.ZERO;


    /**
    * 商家优惠总额
    */
    private BigDecimal sellerDiscount = BigDecimal.ZERO;


    /**
    * 平台优惠补贴
    */
    private BigDecimal platformDiscount = BigDecimal.ZERO;


    /**
    * 跨境税代缴
    */
    private String payOther;


    /**
    * 商品税金
    */
    private BigDecimal productTax = BigDecimal.ZERO;


    /**
    * 佣金
    */
    private BigDecimal commissionAmount = BigDecimal.ZERO;


    /**
    * 运费实付
    */
    private BigDecimal transportAmount = BigDecimal.ZERO;


    /**
    * 平台运费补贴
    */
    private BigDecimal platformTransportAmount = BigDecimal.ZERO;


    /**
    * 运费税金
    */
    private BigDecimal transportTax = BigDecimal.ZERO;


    /**
    * 支付渠道费
    */
    private BigDecimal payAmount = BigDecimal.ZERO;


    /**
    * 分销佣金
    */
    private BigDecimal distributeCommission = BigDecimal.ZERO;


    /**
    * 服务商佣金
    */
    private BigDecimal serviceCommission = BigDecimal.ZERO;


    /**
    * 花呗分期手续费
    */
    private BigDecimal hbCommission = BigDecimal.ZERO;


    /**
    * 分期费率
    */
    private BigDecimal stageRate = BigDecimal.ZERO;


    @TableField(exist = false)
    private String billMonth;
    @TableField(exist = false)
    private String tableName;
    /**
    * 备注
    */
    private String remark;

    // 截取长度超出范围的字段
    public void cutString() {
        if (this.remark != null && this.remark.length() > 2000) {
            this.remark = this.remark.substring(0, 2000);
        }
    }

}
